home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- //
- //
- // Alias|Wavefront Script File
- // MODIFY THIS AT YOUR OWN RISK
- //
- // Creation Date: 26 June 1997
- // Author: jb
- //
- // Description:
- // This procedure sets the selection mode.
- //
- // Input Arguments:
- // A name for the higer level selection mode.
- // A ui name for the mode.
- //
- // Return Value:
- // None.
- //
- // ***********************************************************************
- //
- // Warning:
- // Be sure that any changes made in this file are also reflected in
- // getSelectMode.mel
- //
- // ***********************************************************************
-
- proc setOnlyMasks( string $masks[])
- {
- int $i;
- string $cmd;
-
- for ($i = 0; $i < size($masks); $i++) {
- $cmd = "selectType -" + $masks[$i] + " true;";
- eval($cmd);
- }
- }
-
- global proc setSelectMode( string $mode, string $uiString ) {
- //
- // Set the selection masks using a case statement
- //
- global string $gAnimationSelectionMasksOn[];
- global string $gNURBSelectionMasksObjects[];
- global string $gNURBSelectionMasksComponents[];
- global string $gDeformersSelectionMasksObjects[];
- global string $gDeformersSelectionMasksComponents[];
- global string $gRenderingSelectionMasksObjects[];
- global string $gRenderingSelectionMasksComponents[];
-
- // When switching from a standard selection mode to a non-standard
- // selection mode, we want to save the selection state (mode, prefs
- // and masks). When we return to a standard selection mode from
- // a non-standard selection mode, we want to restore the selection
- // state.
-
- switch( $mode ) {
-
- // standard selection modes
-
- case "hierarchy":
- selectionMaskRestoreOnce();
- selectMode -hierarchical;
- break;
- case "root":
- selectionMaskRestoreOnce();
- selectMode -root;
- break;
- case "leaf":
- selectionMaskRestoreOnce();
- selectMode -leaf;
- break;
- case "template":
- selectionMaskRestoreOnce();
- selectMode -template;
- break;
-
- case "objects":
- selectionMaskRestoreOnce();
- selectMode -object;
- break;
-
- case "components":
- selectionMaskRestoreOnce();
- selectMode -component;
- break;
-
- // custom selection modes
-
- case "animation":
- selectionMaskSaveOnce();
- selectMode -object;
- selectPriority -allObjects 1;
- selectPref -ignoreSelectionPriority false;
- selectPriority
- -handle 5
- -ikHandle 5
- -joint 4;
- selectType -allObjects false -allComponents false;
- setOnlyMasks($gAnimationSelectionMasksOn);
- break;
- case "nurbsModeling":
- selectionMaskSaveOnce();
- selectMode -preset;
- selectPref -ignoreSelectionPriority false;
- selectPref -allowHiliteSelection false;
- selectPriority -allComponents 1;
- selectPriority -isoparm 2;
-
- selectType -allObjects false -allComponents false;
- setOnlyMasks($gNURBSelectionMasksObjects);
- setOnlyMasks($gNURBSelectionMasksComponents);
-
- break;
- case "polyModeling":
- selectionMaskSaveOnce();
- selectMode -component;
- selectType -allObjects false -allComponents false;
- selectPref -ignoreSelectionPriority true;
- selectPref -allowHiliteSelection true;
- selectType
- -polymesh true
- -subdiv true
- -plane true
- -facet true;
- break;
- case "deformations":
- selectionMaskSaveOnce();
- selectMode -preset;
- selectPref -ignoreSelectionPriority false;
- selectPref -allowHiliteSelection false;
- selectPriority -allObjects 1 -allComponents 1;
- selectPriority
- -sculpt 5
- -nonlinear 5
- -lattice 5
- -cluster 5
- -locator 5;
- selectType -allObjects false -allComponents false;
- setOnlyMasks($gDeformersSelectionMasksObjects);
- setOnlyMasks($gDeformersSelectionMasksComponents);
- break;
- case "dynamics":
- selectionMaskSaveOnce();
- selectMode -preset;
- selectType -allObjects false -allComponents false;
- selectType
- -particleShape true
- -emitter true
- -field true
- -fluid true
- -collisionModel true
- -spring true
- -rigidBody true
- -rigidConstraint true
- -particle true
- -springComponent true;
- selectPref -allowHiliteSelection true;
- break;
- case "rendering":
- selectionMaskSaveOnce();
- selectMode -preset;
- selectType -allObjects false -allComponents false;
- setOnlyMasks($gRenderingSelectionMasksObjects);
- setOnlyMasks($gRenderingSelectionMasksComponents);
- selectPref -allowHiliteSelection false;
- break;
- case "vertices":
- selectionMaskSaveOnce();
- selectMode -component;
- selectType -allObjects false -allComponents false;
- selectType
- -controlVertex true
- -subdivMeshPoint true
- -vertex true
- -latticePoint true
- -particle true;
- break;
- case "hulls":
- selectionMaskSaveOnce();
- selectMode -component;
- selectType -allObjects false -allComponents false;
- selectType
- -hull true;
- break;
- case "lines":
- selectionMaskSaveOnce();
- selectMode -component;
- selectType -allObjects false -allComponents false;
- selectType
- -isoparm true
- -polymeshEdge true
- -subdivMeshEdge true
- -surfaceEdge true
- -springComponent true;
- break;
- case "points":
- selectionMaskSaveOnce();
- selectMode -component;
- selectType -allObjects false -allComponents false;
- selectType
- -editPoint true
- -curveParameterPoint true
- -surfaceParameterPoint true
- -polymeshUV true
- -subdivMeshUV true;
- break;
-
- case "allComponents":
- selectionMaskRestoreOnce();
- selectionMaskSaveOnce();
- selectMode -component;
- selectType -allObjects false -allComponents true;
- break;
- case "allObjects":
- selectionMaskRestoreOnce();
- selectionMaskSaveOnce();
- selectMode -object;
- selectType -allObjects true -allComponents false;
- selectPref -ignoreSelectionPriority true;
- break;
-
- default:
- selectionMaskRestoreOnce();
- selectMode -object;
- selectType -allObjects true -allComponents false;
- selectPref -ignoreSelectionPriority false;
- break;
- }
- if ($uiString != "") {
- textField -e -tx $uiString maskField;
- }
- }
-